-
-
Notifications
You must be signed in to change notification settings - Fork 404
Draft: Implement watching file paths via oslib.watch
(for 0.12.x
branch)
#5073
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lihaoyi
merged 19 commits into
com-lihaoyi:0.12.x
from
arturaz:improvement/fs-watching-0.12.x
May 19, 2025
Merged
Draft: Implement watching file paths via oslib.watch
(for 0.12.x
branch)
#5073
lihaoyi
merged 19 commits into
com-lihaoyi:0.12.x
from
arturaz:improvement/fs-watching-0.12.x
May 19, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25e1fb5
to
caffff7
Compare
lihaoyi
reviewed
May 8, 2025
lihaoyi
reviewed
May 8, 2025
lihaoyi
reviewed
May 8, 2025
7c1395f
to
063e47f
Compare
Noticed this popping up while testing (note for self):
|
…hing-0.12.x' into improvement/fs-watching-0.12.x
lihaoyi
pushed a commit
that referenced
this pull request
May 19, 2025
Currently watching files uses polling which is inefficient with large codebases. On my laptop `./mill --watch` uses 20% CPU just to watch the files for changes. This uses `oslib`'s `watch` module to watch for the file changes instead of polling them. We had to update oslib (com-lihaoyi/os-lib#386) to: - add a capability of filtering what folders it watches. This is needed because watching large generated folders like `out` or `.bloop` emits Java FS watcher `OVERFLOW` events. - remove the random `println`'s that `oslib.watch` had. The current approach to watching is to watch the workspace root via FS watching. FS watching only works with folders and we have to watch `root/build.mill`, and thus, `root/`, so everything else falls under it. Mac OS watcher performs watching recursively natively, but on linux oslib adds recursive watches itself, so we use `oslib.watch` filter to prevent watching anything that is not an ancestor of watched root. For example, if we have source at `root/module-a/src/`, we'll watch `root/`, `root/module-a/` and `root/`. Finally, events are filtered so that unrelated changes (like creating `root/random-file.txt`) does not trigger reevaluation. The fs watching is enabled by default and can be disabled via `--watch-via-fs-notify=false`. `0.12.x` version: #5073 --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…into improvement/fs-watching-0.12.x
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #5068
The fs watching is disabled by default and can be enabled via
--notify-watch=true
.